<?php

namespace Action\Flow\GenericFlow\Comment;

class Unlike extends \Library\Action\UserAction
	implements \Library\Action\AjaxAction {

	private $_comment;

	public function execute() {
		parent::execute();
		
		$comment_id = $this->getParam( 'id' );
		$this->_comment = \Bean\Flow\GenericFlow\Comment::get( $comment_id );
		
		_a( $this->_comment->isLikable(), 'You can\'t like this comment' );

		$this->_comment->unlike();

	}
	
	public function getComment() {
		return $this->_comment;
	}

}
